package com.example.demo;

import com.example.demo.entity.aaa;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class HelloController {
    @GetMapping("/hello")
    public Map<String,Object> hello(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("name","樊博士");
        map.put("age","18");
        return map;
    }
    @Autowired
    private aaa aaa;
    @GetMapping("/demo")
    public aaa demo(){
        return aaa;
    }
    @Value("${server.port}")
    private Integer port;
    @Value("${aaa.id}")
    private String id;
    @GetMapping("/info")
    public String info(){
        return "端口号"+port+"id="+id;
    }
}
